<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="RateChange.aspx.vb" Inherits="Default2" title="GTS Frieght Management System" MaintainScrollPositionOnPostback="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
    <h3>Manage Contract Rates</h3>
    <asp:Label ID="Message" runat="server" ForeColor="Red"></asp:Label>
    
    <table>
        <tr valign="top" align="center">
            <td align="right">Select Carrier:</td>
            <td style="width: 335px" align="left">
                <asp:DropDownList ID="ddlContractCarrier" runat="server" AutoPostBack="True" DataSourceID="ContractINFO"
                    DataTextField="CarrierName" DataValueField="ContractID" Width="152px" AppendDataBoundItems="True">
                    <asp:ListItem Value="-1">Select Carrier</asp:ListItem>
                </asp:DropDownList>
                &nbsp;</td>
        </tr>
        <tr valign="top" align="center">
            <td align="right">Percent Change:</td>
            <td style="width: 335px" align="left"><asp:TextBox ID="txtPercent" runat="server" Width="88px" MaxLength="3"></asp:TextBox>&nbsp;
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPercent"
                    ErrorMessage="Required field"></asp:RequiredFieldValidator></td>
        </tr>
        <tr valign="top" align="center">
            <td colspan="2">
                <asp:RadioButtonList ID="radDirection" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="1" Selected="True">Increase</asp:ListItem>
                    <asp:ListItem Value="2">Decrease</asp:ListItem>
                </asp:RadioButtonList></td>

        </tr>
        <tr valign="top" align="center">
            <td colspan="2">
                <asp:LinkButton ID="lbCommit" runat="server">Update Contract Rates</asp:LinkButton></td>

        </tr>
    </table>
    <asp:ObjectDataSource ID="ContractINFO" runat="server" InsertMethod="AddContract"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetContractInfoByClientBranchID"
        TypeName="GTSSystem.BLL.Contract">
        <SelectParameters>
            <asp:ProfileParameter Name="ClientBranchID" PropertyName="BranchId" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="ClientID" Type="Int32" />
            <asp:Parameter Name="ClientBranchID" Type="Int32" />
            <asp:Parameter Name="CarrierID" Type="Int32" />
            <asp:Parameter Name="ContractStartDate" Type="DateTime" />
            <asp:Parameter Name="ContractEndDate" Type="DateTime" />
        </InsertParameters>
    </asp:ObjectDataSource>
    &nbsp;
    <asp:GridView ID="gdvwContractRates" runat="server" Caption="Contract Rates" CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%" DataKeyNames="Rate Detail ID" AutoGenerateColumns="False">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <EditRowStyle BackColor="#999999" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="Rate Detail ID" HeaderText="Rate Detail ID" Visible="False" />
            <asp:BoundField DataField="Origin" HeaderText="Origin" />
            <asp:BoundField DataField="Destination" HeaderText="Destination" />
            <asp:BoundField DataField="Service Type" HeaderText="Service Type" />
            <asp:BoundField DataField="Minimum Weight" HeaderText="Min. Weight" />
            <asp:BoundField DataField="Maximum Weight" HeaderText="Max Weight" />
            <asp:BoundField DataField="Rate Charge" DataFormatString="{0:C}" HeaderText="Rate Charge"
                HtmlEncode="False" />
            <asp:BoundField DataField="Base Rate" DataFormatString="{0:C}" HeaderText="Base Rate"
                HtmlEncode="False" />
            <asp:BoundField DataField="Minimum Charge" DataFormatString="{0:C}" HeaderText="Min. Charge"
                HtmlEncode="False" />
            <asp:BoundField DataField="Rate Type" HeaderText="Rate Type" />
        </Columns>
    </asp:GridView>
</asp:Content>

